<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>

<html>
	<script type="text/javascript" src="<c:url value="/resources/script/jquery/jconfirmaction.jquery.js"/>"></script>
	<script type="text/javascript">	
		$(document).ready(function() {
			$('.ask').jConfirmAction();
		});	
		
		function toggle(source) {
			checkboxes = document.getElementsByName('foo');
			for ( var i in checkboxes)
				checkboxes[i].checked = source.checked;
		}
		
		function ChangeState(obj) {
			var act = obj.disabled ? false : true;
			obj.disabled = act;
		}
	</script>
<head>
</head>
<body>
<div>
	<form action="" name="formRestore" method="post">
		<table>
			<tr>
				<th align="left"><h2>Deleted Histories</h2></th>
				<th>
					<a
					href="<c:url value="/item/history/searchHistory"/>"
					class="bt_green"><span class="bt_green_lft"></span><strong>
					Back to Active History</strong><span class="bt_green_r"></span></a>
				</th>
			</tr>
			<tr>
				<td colspan="2">
					
						<table id="rounded-corner"
							summary="2007 Major IT Companies' Profit">
							<thead>
								<tr>
									<th scope="col" class="rounded-company"><input
										type="checkbox" onClick="toggle(this); ChangeState(box);" />
									</th>
									<th scope="col" class="rounded"><b>Date</b></th>
									<th scope="col" class="rounded"><b>Item</b></th>
									<th scope="col" class="rounded"><b>Location</b></th>
									<th scope="col" class="rounded"><b>User</b></th>
									<th scope="col" class="rounded-q4"><b>Restore</b></th>
								</tr>
							</thead>
							<tbody>
								<c:forEach var="deletedHist" items="${deletedHist}" varStatus="status">
									<tr>
										<td><input type="checkbox" name="foo" onClick="ChangeState(box);"
											value="${deletedHist.id}" /></td>
										<td>${deletedHist.date}</td>
										<td>${deletedHist.item.code}</td>
										<td>${deletedHist.location.position}</td>
										<td>${deletedHist.user.name}</td>
										<td><a class="ask"
											href="<c:url value="/item/history/restore?id=${deletedHist.id}"/>"><img
												src="<c:url value="/resources/images/images/restore.png"/>"
												alt="" title="" border="0" /> </a></td>
									</tr>
								</c:forEach>
							</tbody>
							<tfoot>
								<tr>
									<td colspan="5" class="rounded-foot-left"><em>@Xsis
											Mitra Utama</em></td>
									<td class="rounded-foot-right">&nbsp;</td>
								</tr>
							</tfoot>
						</table>
					
				</td>
			</tr>
			<tr>
				<td colspan="2" align="right">
					<input type="submit" id="box" value="submit" disabled class="bt_green"/>
					
					<a onclick="document.formRestore.submit()"
					href="<c:url value="#"/>"
					class="bt_green"><span class="bt_green_lft"></span><strong>
					 Restore </strong><span class="bt_green_r"></span> </a>
				</td>
			</tr>
		</table>
	</form>
</div>
</body>
</html>